package com.dada.lib.deeplink;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;


/**
 * Created by cd5160866 on 07/03/2018.
 */

public class DeepLinkEntryActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.d("qw", "开始处理link");
        dealWithDeepLink();
        finish();
    }

    private void dealWithDeepLink() {
        Intent intent = getIntent();
        if (intent == null)
            return;

        Uri data = intent.getData();
        if (data == null)
            return;

        if (null != DeepLink.getLinkListener())
            DeepLink.getLinkListener().onLinkSuccess(this, data);
    }

    @Override
    protected void onDestroy() {
        Log.d("qw", "处理完成");
        super.onDestroy();
    }
}
